-- mods/default/aliases.lua

-- Aliases to support loading worlds using nodes following the old naming convention
-- These can also be helpful when using chat commands, for example /giveme
minetest.register_alias("stone", "default:stone")
minetest.register_alias("stone_with_coal", "default:stone_with_coal")
minetest.register_alias("stone_with_iron", "default:stone_with_iron")
minetest.register_alias("dirt_with_grass", "default:dirt_with_grass")
minetest.register_alias("dirt_with_grass_footsteps", "default:dirt_with_grass_footsteps")
minetest.register_alias("dirt", "default:dirt")
minetest.register_alias("sand", "default:sand")
minetest.register_alias("gravel", "default:gravel")
minetest.register_alias("sandstone", "default:sandstone")
minetest.register_alias("clay", "default:clay")
minetest.register_alias("brick", "default:brick")
minetest.register_alias("tree", "default:tree")
minetest.register_alias("jungletree", "default:jungle_tree")
minetest.register_alias("junglegrass", "default:jungle_grass")
minetest.register_alias("leaves", "default:leaves")
minetest.register_alias("cactus", "default:cactus")
minetest.register_alias("papyrus", "default:papyrus")
minetest.register_alias("bookshelf", "default:bookshelf")
minetest.register_alias("glass", "default:glass")
minetest.register_alias("wooden_fence", "default:fence_wood")
minetest.register_alias("rail", "carts:rail")
minetest.register_alias("ladder", "default:ladder_wood")
minetest.register_alias("wood", "default:wood")
minetest.register_alias("mese", "default:mese")
minetest.register_alias("cloud", "default:cloud")
minetest.register_alias("water_flowing", "default:water_flowing")
minetest.register_alias("water_source", "default:water_source")
minetest.register_alias("lava_flowing", "default:lava_flowing")
minetest.register_alias("lava_source", "default:lava_source")
minetest.register_alias("torch", "default:torch")
minetest.register_alias("sign_wall", "default:sign_wall_wood")
minetest.register_alias("furnace", "default:furnace")
minetest.register_alias("chest", "default:chest")
minetest.register_alias("locked_chest", "default:chest_locked")
minetest.register_alias("cobble", "default:cobble")
minetest.register_alias("mossycobble", "default:mossycobble")
minetest.register_alias("steelblock", "default:steelblock")
minetest.register_alias("sapling", "default:sapling")
minetest.register_alias("apple", "default:apple")

minetest.register_alias("WPick", "default:pick_wood")
minetest.register_alias("STPick", "default:pick_stone")
minetest.register_alias("SteelPick", "default:pick_steel")
minetest.register_alias("MesePick", "default:pick_mese")
minetest.register_alias("WShovel", "default:shovel_wood")
minetest.register_alias("STShovel", "default:shovel_stone")
minetest.register_alias("SteelShovel", "default:shovel_steel")
minetest.register_alias("WAxe", "default:axe_wood")
minetest.register_alias("STAxe", "default:axe_stone")
minetest.register_alias("SteelAxe", "default:axe_steel")
minetest.register_alias("WSword", "default:sword_wood")
minetest.register_alias("STSword", "default:sword_stone")
minetest.register_alias("SteelSword", "default:sword_steel")

minetest.register_alias("Stick", "default:stick")
minetest.register_alias("paper", "default:paper")
minetest.register_alias("book", "default:book")
minetest.register_alias("lump_of_coal", "default:coal_lump")
minetest.register_alias("lump_of_iron", "default:iron_lump")
minetest.register_alias("lump_of_clay", "default:clay_lump")
minetest.register_alias("steel_ingot", "default:steel_ingot")
minetest.register_alias("clay_brick", "default:clay_brick")
minetest.register_alias("snow", "default:snow")

-- 'mese_block' was used for a while for the block form of mese
minetest.register_alias("default:mese_block", "default:mese")

-- Aliases for corrected pine node names
minetest.register_alias("default:pinetree", "default:pine_tree")
minetest.register_alias("default:pinewood", "default:pine_wood")

-- Misc. old-isms
minetest.register_alias("default:sign", "default:sign_wall_wood")
minetest.register_alias("default:ladder", "default:ladder_wood")
minetest.register_alias("default:sign_wall", "default:sign_wall_wood")

-- Renaming the jungles
minetest.register_alias("default:junglewood", "default:jungle_wood")
minetest.register_alias("default:jungletree", "default:jungle_tree")
minetest.register_alias("default:jungleleaves", "default:jungle_leaves")
minetest.register_alias("default:junglesapling", "default:jungle_sapling")
minetest.register_alias("default:junglegrass", "default:jungle_grass")
minetest.register_alias("junglegrass:shortest", "default:jungle_grass")
minetest.register_alias("junglegrass:short", "default:jungle_grass")
minetest.register_alias("junglegrass:medium", "default:jungle_grass")
minetest.register_alias("junglegrass:long", "default:jungle_grass")
minetest.register_alias("default:emergent_jungle_sapling", "default:jungle_sapling")
minetest.register_alias("default:fence_junglewood", "default:fence_jungle_wood")
minetest.register_alias("default:fence_rail_junglewood", "default:fence_rail_jungle_wood")

-- Weird old flowery-things
minetest.register_alias("default:grass_5", "default:grass_4")

-- Torchery-sorcery
minetest.register_alias("default:torch_wall", "default:torch")
minetest.register_alias("default:torch_ceiling", "default:torch")
minetest.register_alias("poudlard:torch_wall", "default:torch")

-- Compatibility with OCD-isms
minetest.register_alias("default:torch_out", "default:torch")
minetest.register_alias("default:stick", "default:wood")

-- Fences mod
for i = 1, 35 do
	minetest.register_alias("fences:fence_wood_" .. i, "default:fence_wood")
end
minetest.register_alias("fences:fence_wood", "default:fence_wood")
minetest.register_alias("fences:fencegate_open", "doors:gate_wood_open")
minetest.register_alias("fences:fencegate", "doors:gate_wood_closed")

-- Old craftguide mod
minetest.register_alias("craftguide:sign", "default:sign_wall_wood")
minetest.register_alias("craftguide:book", "default:book")

-- Poudlard aliases
minetest.register_alias("poudlard:poudstone", "default:stone")
minetest.register_alias("poudlard:poudwood", "default:wood")
minetest.register_alias("poudlard:blackblock", "default:coalblock")
minetest.register_alias("poudlard:redblock", "default:bronzeblock")
minetest.register_alias("poudlard:junglewood", "default:jungle_wood")
minetest.register_alias("poudlard:stonebrick", "default:stonebrick")
minetest.register_alias("poudlard:stone_tile", "default:cobble")
minetest.register_alias("poudlard:split_stone_tile", "default:cobble")
minetest.register_alias("poudlard:circlestonebricks", "default:stonebrick")
minetest.register_alias("poudlard:ironstonebricks", "default:obsidianbrick")
minetest.register_alias("poudlard:plankstone", "default:wood")
minetest.register_alias("poudlard:ironglass", "default:glass")
minetest.register_alias("poudlard:cleanglass", "default:glass")
minetest.register_alias("poudlard:coalglass", "default:obsidian_glass")
minetest.register_alias("poudlard:cactuschecker", "default:cactus")
minetest.register_alias("poudlard:emptybookshelf", "default:bookshelf")
minetest.register_alias("poudlard:coalstone", "default:stone_with_coal")
minetest.register_alias("poudlard:ironstone", "default:stone_with_iron")
minetest.register_alias("poudlard:coalchecker", "default:stone_with_coal")
minetest.register_alias("poudlard:ironchecker", "default:stone_with_iron")
minetest.register_alias("poudlard:trapstone", "default:cobble")
minetest.register_alias("poudlard:trapglass", "default:glass")
minetest.register_alias("poudlard:fence_junglewood", "default:fence_junglewood")
minetest.register_alias("poudlard:horizontaltree", "default:jungle_tree")
minetest.register_alias("poudlard:allfacestree", "default:jungle_tree")
minetest.register_alias("poudlard:alltree", "default:jungle_tree")
minetest.register_alias("poudlard:superglowglass", "default:meselamp")
minetest.register_alias("poudlard:rope", "air")
minetest.register_alias("poudlard:wood_tile", "default:wood")
minetest.register_alias("poudlard:wood_tile_full", "default:wood")
minetest.register_alias("poudlard:wood_tile_center", "default:wood")
minetest.register_alias("poudlard:secretbookshelf", "default:bookshelf")
minetest.register_alias("poudlard:junglestick", "default:wood")
minetest.register_alias("poudlard:sweeper", "default:pick_wood")

-- Misc. old entities
minetest.register_entity(":wield3d:wield_entity", {
	on_activate = function(self)
		minetest.log("action", "wield3d:wield_entity was found, purging.")
		self.object:remove()
	end
})
